import 'dart:io';
import 'package:path_provider/path_provider.dart';
class PathUtils{
  static PathUtils _pathUtils;
  static Future<PathUtils> get instance async=>_getInstance();
  final Directory documentsDirectory;
  final Directory tempDirectory;
  PathUtils.internal({this.tempDirectory,this.documentsDirectory});

  static Future<PathUtils> _getInstance() async{
    Directory documentDirectory;
    Directory tempDirectory;
    if(_pathUtils==null){
     await getApplicationDocumentsDirectory().then((value){
       documentDirectory=value;

     });
      await getTemporaryDirectory().then((value){
       tempDirectory=value;
     });
      _pathUtils=PathUtils.internal(tempDirectory: tempDirectory,documentsDirectory: documentDirectory);
    }
    return _pathUtils;
  }
}